#include "grate_test_utils.h"
#include "grate/util/stack.h"

using growth_rate::Stack;

namespace {

TEST(StackTest, Basic) {
  Stack<int> stack(5);
  EXPECT_TRUE(stack.is_empty());
  stack.push(4);
  stack.push(2);
  EXPECT_EQ(2, stack.top());
  EXPECT_EQ(2, stack.pop());
  EXPECT_FALSE(stack.is_empty());
  stack.push(3);
  EXPECT_EQ(3, stack.pop());
  EXPECT_EQ(4, stack.pop());
  EXPECT_TRUE(stack.is_empty());
}

}  // namespace
